package com.yc.think.body;

import org.apache.commons.lang.RandomStringUtils;

/**
 * author: yc
 * description: ${description}
 * date: 2021/7/9 17:47
 */
public class Env {

    private Body body;
    public Env(Body body) {
        this.body = body;
    }

    /**
     * 接收外部输入 并 按一定规律调用Body的input
     * @param p
     */
    public void input(String p) {
        //规律：把小写字母转成大写字母
        body.input(p.toUpperCase());
    }

    /**
     * 随机对外（Body）输出(大写字母)
     * @return
     */
    public void output() {
        body.input(RandomStringUtils.randomAlphanumeric(1).toUpperCase());
    }
}
